package Thread;

public class ThreadDemo3 extends Thread{
    public static void main(String[] args) {
        //继承Thread重写run方法
        Thread t = new Thread(()->{
                for (int i = 0; i < 10; i++) {
                    System.out.println("你好");
                }
        });

        //实现Runnable接口重写run方法
        Runnable r = new Runnable() {
            @Override
            public void run() {
                for (int i = 0; i < 10; i++) {
                    System.out.println("6");
                }
            }
        };
        r.run();
        t.start();


    }
}
